package com.start.ws.handler;

public interface StartBaseSocketMsgHandler<T> {
    String handlerMsgType();

    /**
     * 接收到消息
     * @param startUserType
     * @param sendClientType  发送人客户类型
     * @param userId          发送人用户id
     * @param msg             消息内容
     */
    default void onReceive(String startUserType,String sendClientType, String userId, T msg) {
        onReceive(startUserType, sendClientType, userId, msg, null);
    }



    /**
     * 接收到消息
     *
     * @param startUserType
     * @param sendClientType  发送人客户类型
     * @param userId          发送人用户id
     * @param msg             消息内容
     * @param sendClientMsgId 发送人客户端消息id
     */
     void onReceive(String startUserType,String sendClientType, String userId, T msg, String sendClientMsgId);

    T formatMsg(String msg);
}
